<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopCarTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_car', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("user_id")->comment("用户ID");
            $table->integer("goods_id")->comment("商品ID");
            $table->integer("sku_id")->comment("规格ID");
            $table->integer("color_id")->comment("颜色ID");
            $table->integer("selected")->default(0)->comment("选中状态");
            $table->integer("goods_num")->default(1)->comment("数量");
            $table->decimal("amount",10,2)->default(0)->comment("总价");
            $table->decimal("score",10,2)->default(0)->comment("总积分");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_car');
    }
}
